<html>
<head><meta charset="utf-8"><title>WG scope · project-ffi-unwind · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/index.html">project-ffi-unwind</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html">WG scope</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="178414854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178414854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178414854">(Oct 17 2019 at 19:45)</a>:</h4>
<blockquote>
<p>The harm I see is that the WG won't end up fulfilling its goal of offering a way to interface with the platform ABI</p>
</blockquote>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> I think this statement makes "interface" sound like a bit more of an all-or-nothing proposition than it is. "Propagating" (without catching) is one way of "interfacing" with the exception ABI.</p>



<a name="178415057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415057">(Oct 17 2019 at 19:47)</a>:</h4>
<p>Also, I think we need to be very cautious about making assumptions about what "supporting the ABI" entails (even for a fairly comprehensive definition of "supporting") without limiting those assumptions to specific platforms. In particular, for any goals that this WG adopts because they seem desirable and achievable for the Itanium ABI, we need to be careful not to automatically commit ourselves to supporting the same feature on Windows.</p>



<a name="178415060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415060">(Oct 17 2019 at 19:47)</a>:</h4>
<p>I don't think we should treat it as all or nothing, but on some major platforms, native system software pretty much uses all of the ABI</p>



<a name="178415083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415083">(Oct 17 2019 at 19:47)</a>:</h4>
<p>so if we want to be able to properly interface with such software from Rust, then we'd need to support whatever parts of the ABI such software requires</p>



<a name="178415137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415137">(Oct 17 2019 at 19:48)</a>:</h4>
<p>That's reasonable. Josh Triplett is correct that _catching_ foreign exceptions was not originally in scope for this WG, though.</p>



<a name="178415153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415153">(Oct 17 2019 at 19:48)</a>:</h4>
<p>It definitely seems like a natural extension of the charter</p>



<a name="178415175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415175">(Oct 17 2019 at 19:48)</a>:</h4>
<p>but it is not something I think we can _currently_ commit to solving.</p>



<a name="178415177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415177">(Oct 17 2019 at 19:48)</a>:</h4>
<blockquote>
<p>lso, I think we need to be very cautious about making assumptions about what "supporting the ABI" entails (even for a fairly comprehensive definition of "supporting") without limiting those assumptions to specific platforms. </p>
</blockquote>
<p>That's a good point.</p>



<a name="178415200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415200">(Oct 17 2019 at 19:49)</a>:</h4>
<p>I've been wondering these last days if it wouldn't be better to just expose platform ABIs instead of a generic "C unwind" ABI</p>



<a name="178415226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415226">(Oct 17 2019 at 19:49)</a>:</h4>
<p>But I think that could be always done later</p>



<a name="178415246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415246">(Oct 17 2019 at 19:49)</a>:</h4>
<p>e.g. adding "C unwind" now does not prevent adding "Itanium" or "SEH" later</p>



<a name="178415250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415250">(Oct 17 2019 at 19:49)</a>:</h4>
<p>For cases where interactions with foreign exceptions are necessary, platform-specific features may indeed be a good approach!</p>



<a name="178415337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415337">(Oct 17 2019 at 19:50)</a>:</h4>
<p>I do think that <code>"C unwind"</code>, without any support for interacting with exception objects, solves enough real-world use cases to be valuable on its own</p>



<a name="178415347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415347">(Oct 17 2019 at 19:50)</a>:</h4>
<p>But all of the unwindings that we end up supporting, might end up interacting with Rust frames at some point, and therefore with catch_unwind in those frames</p>



<a name="178415524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415524">(Oct 17 2019 at 19:52)</a>:</h4>
<blockquote>
<p>I do think that "C unwind", without any support for interacting with exception objects, solves enough real-world use cases to be valuable on its own</p>
</blockquote>
<p>Yes, I think so. I guess that my view is that if it were to support foreign exceptions, it would solve the majority of cases, leaving no room below for other language features.</p>



<a name="178415531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178415531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178415531">(Oct 17 2019 at 19:52)</a>:</h4>
<blockquote>
<p>unwindings ...might end up interacting...with catch_unwind </p>
</blockquote>
<p>I think that it's okay to leave that undefined (possibly indefinitely), though. Do you think that would be specifically "more wrong" than, e.g., leaving it undefined behavior to <code>longjmp</code> over frames with <code>Drop</code> objects?</p>



<a name="178998007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/WG%20scope/near/178998007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/WG.20scope.html#178998007">(Oct 24 2019 at 21:11)</a>:</h4>
<blockquote>
<p>But I think that could be always done later</p>
</blockquote>
<p>I think this could be done later and I also think Rust has a strong commitment to making cross-platform portability work and work well. I think that applies here. You should be able to do "basic stuff" portably, the concepts are very similar.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>